import request from "../utils/request";


export function getUser(openid) {
    return request({
        url: '/api/user/getUser?openid=' + openid,
        method: 'GET'
    })
}

/**
 * 得到openid信息
 * @param res
 * @returns {Promise | Promise<unknown>}
 */
export function getWeixinOpenid(res) {
    return request({
        url: '/api/user/getWeixinOpenid?js_code=' + res.code,
        method: 'GET'
    })
}

/**
 * 保存用户
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export function saveUser(data) {
    return request({
        url: '/api/user/saveUser',
        method: 'POST',
        data
    });
}
